#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int main()
{
	int m, n, sum = 0, t;
	scanf("%d%d", &m, &n);
	int arr[7][7];
	for (int i = 0; i < m; i++)
	{
		sum = 0;
		for (int j = 0; j < n; j++)
		{
			scanf("%d", &t);
			sum += t;
		}
		printf("%d\n", sum);
	}
	return 0;
}